// import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const cityPinia = defineStore('cityPinia',{
  state:()=>{
    return{
      cityId:null,
      city:null
    }
  },
  
}
)

export const moviePinia = defineStore('moviePinia',{
  state() {
      return{
        order:[],
        cinemaNamePinia:'111',
        movieNamePinia:'222',
        hallPinia:'333',
        langPinia:'',
        typePinia:'',
        chooseDayPinia:'',
        durationPinia:'',
        price:null,
        cinemaIdPinia:null,
        movieIdPinia:null,
        imgPinia:''
      }
  },
  actions:{
    addOrder(img:string,movieName:string,type:string,movieId:number,cinemaId:number,totalPrice:number,seatList:object,date:string,time:string,hall:string,cinemaNamePinia:string){
      console.log(123);
      let id = new Date().getTime()
      let obj = {
        img,
        movieName,
        type,
        movieId,
        cinemaId,
        totalPrice,
        seatList,
        date,
        time,
        hall,
        cinemaNamePinia,
        id
      };
      this.order=[obj,...this.order]
    },
  }
})